import java.util.Scanner;

public class TJZF {
    private char[] a;

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        while (scanner.hasNext()) {
            int isLetter=0,isDigit=0,isWhitespace=0,isQt=0;
            char[] a = scanner.nextLine().toCharArray();

            for (Character c: a) {
                if(Character.isLetter(c))
                    isLetter++;
                else if (Character.isDigit(c))
                    isDigit++;
                else if (Character.isWhitespace(c))
                    isWhitespace++;
                else
                    isQt++;

            }

            System.out.println(isLetter);
            System.out.println(isWhitespace);
            System.out.println(isDigit);
            System.out.println(isQt);


        }


    }
}
